// 文章相关的API接口
import request from '@/utils/request.js'

export const getCateListAPI = () => {
  return request.get('/my/cate/list')
}

export const addCateAPI = (obj) => {
  return request.post('/my/cate/add', obj)
}

export const updateCateAPI = (obj) => {
  return request.put('/my/cate/info', obj)
}

export const deleteAPI = (id) => {
  return request.delete('/my/cate/del', {
    params: { id }
  })
}
// 发布文章接口(简易写法，只有一行代码的时候可以简写)
export const pubArtcleAPI = (fd) => request.post('/my/article/add', fd)

// 获取文章列表接口
export const getArtListAPI = (q) => {
  return request.get('/my/article/list', {
    params: q
  })
}

// 获取文章详情接口
export const getArtcleAPI = (id) => request.get('/my/article/info', { params: { id } })

// 删除文章接口
export const deleteArticleAPI = (id) => request.delete('/my/article/info', { params: { id } })
